package co.yixiang.config.thread;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;

import java.util.ArrayList;
import java.util.List;

public class ExcelListener extends AnalysisEventListener {

    private List<Object> datas = new ArrayList<>();

    @Override
    public void invoke(Object o, AnalysisContext analysisContext) {
        datas.add(o);//逐行添加解析数据
    }

    @Override
    public void doAfterAllAnalysed(AnalysisContext analysisContext) {

    }

    //获取所有数据
    public List<Object> getData() {
        return datas;
    }

    public void setData(List<Object> datas) {
        this.datas = datas;
    }

}
